****************************************************************************************
****************************************************************************************
**  FIGURE A5
****************************************************************************************
****************************************************************************************
use "${path}research_clusters_data_table.dta", clear
gen cat_2010=0
replace cat_2010=1 if year_labex==2010 & correspondance!="." & accepted==0
replace cat_2010=2 if year_labex==2010 & accepted==1
lab define categ 0  "rejected not resubmitted" 1 "rejected and resubmitted" 2 "accepted"
lab val cat_2010 categ
lab var note_totale "grade"
gen cat_2011=0
replace cat_2011=1 if year_labex==2011 & correspondance!="." & accepted==0
replace cat_2011=2 if year_labex==2011 & correspondance!="." & accepted==1
replace cat_2011=3 if year_labex==2011 & accepted==1 & correspondance=="."
lab define categ2 0 "rejected not resubmission" 1 "rejected resubmission" 2 "accepted resubmission" 3 "accepted not resubmission"
lab val cat_2011 categ2
bysort labexid: gen id_l=_n
preserve
keep if year_labex==2010
cibar note_totale   if id_l==1, over(cat_2010 ) barcol(ltkhaki dkorange sienna )  ///
graphopts(graphregion(fcolor(white))    ysc(range(0 35)) ylabel(0 (5) 35) legend(cols(1)))  bargap(10)
graph save "note_cat_2010.gph", replace
graph export "note_cat_2010.pdf", replace 
restore 
preserve
keep if year_labex==2011
cibar note_totale   if id_l==1, over(cat_2011 ) barcol(ltkhaki dkorange sienna emerald )  ///
graphopts(graphregion(fcolor(white))    ysc(range(0 35)) ylabel(0 (5) 35) legend(cols(1)))  bargap(10)
 graph save "note_cat_2011.gph", replace
graph export "note_cat_2011.pdf", replace 
 